home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / bprof-1.1 / bprof-1 / bprof / bprof.cat < prev    next >
Encoding:
Text File  |  1994-07-13  |  4.7 KB  |  133 lines

  1.  
  2.  
  3.  
  4. BPROF(1)                                                 BPROF(1)
  5.  
  6.  
  7. NNAAMMEE
  8.        bprof - profile per source line
  9.  
  10. SSYYNNOOPPSSIISS
  11.        bbpprrooff [_o_p_t_i_o_n_s] [_e_x_e_c_u_t_a_b_l_e [_b_m_o_n_._o_u_t ... ] ]
  12.  
  13. DDEESSCCRRIIPPTTIIOONN
  14.        bbpprrooff  makes  an execution profile per source line of your
  15.        program.  In other words, it gives you the time  spent  in
  16.        each  line  of your program.  This allows you to know pre-
  17.        cisely on what part of the program to spend  your  efforts
  18.        at speeding it up.
  19.  
  20.        To  get  such  a profile, compile your program with -g and
  21.        link it with -pg and the  library  libbmon.a.   Make  sure
  22.        that  the bmon library is linked immediately after your .o
  23.        files, before any system libraries.  Example:
  24.  
  25.        ggcccc --gg --cc ffoooo..cc
  26.        ggcccc --gg --cc bbaarr..cc
  27.        ggcccc --ppgg --oo ffuubbaarr ffoooo..oo bbaarr..oo --llbbmmoonn --llmm
  28.  
  29.        You can specify optimization flags.  This will give you  a
  30.        better  estimate of the program behaviour when it is opti-
  31.        mized, but it can make the data hard to interpret  as  the
  32.        relation between source and object code can be obscure.
  33.  
  34.        Running  the program should produce a file bbmmoonn..oouutt in the
  35.        current directory (that is the current  directory  of  the
  36.        program  at  the  moment it exits).  Now run bbpprrooff on your
  37.        executable.  This should  produce  files  ffoooo..cc..bbpprrooff  and
  38.        bbaarr..cc..bbpprrooff which are the same as the corresponding source
  39.        files, but have the time spent in each line  prepended  to
  40.        that  line.  A '--' in the output indicates a line where no
  41.        measurable time was spent, while a '..'  indicates  a  line
  42.        that is not executable at all.
  43.  
  44.        Time  spent  is  measured in clock ticks, so in 1/100 of a
  45.        second.  As timing statistics are taken stochastically  by
  46.        recording  the  instruction each clock tick, these numbers
  47.        are not exact and can vary from one run to another.
  48.  
  49.        The first non-option argument given will be taken  as  the
  50.        name  of  the  executable  (default:  a.out).  Any further
  51.        arguments are interpreted as the names of  bmon.out  files
  52.        (default: bmon.out).  If you specify more such files bbpprrooff
  53.        takes the sum of the timings of these files.
  54.  
  55. OOPPTTIIOONNSS
  56.        --dd _d_i_r_e_c_t_o_r_y
  57.               also use any source files in _d_i_r_e_c_t_o_r_y to make pro-
  58.               files.   You can use multiple --dd flags for multiple
  59.               directories.  The current directory is always used.
  60.  
  61.  
  62.  
  63.  
  64.                     Version 1.1   13 July 1994                  1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. BPROF(1)                                                 BPROF(1)
  71.  
  72.  
  73.               Note  that  in  any  case source files will only be
  74.               looked for by the full path name they  had  at  the
  75.               moment  of  compilation.   If  you  have moved them
  76.               around since compilation, you  need  to  recompile,
  77.               move them back or create a symlink somewhere.
  78.  
  79.        --ss _s_u_f_f_i_x
  80.               use  _s_u_f_f_i_x  instead of ..bbpprrooff to add to the source
  81.               file names to get the output file names.
  82.  
  83. EENNVVIIRROONNMMEENNTT
  84.        BBPPRROOFFDDIIRR
  85.               If this variable is set, the program will write the
  86.               bmon.out file in that directory instead of the cur-
  87.               rent one.
  88.  
  89. FFIILLEESS
  90.        bbmmoonn..oouutt
  91.               contains timing data
  92.  
  93. SSEEEE AALLSSOO
  94.        gprof(1)
  95.  
  96. BBUUGGSS
  97.        I do not know of a way to get the last instruction address
  98.        of  a  source line without looking at the next line.  This
  99.        means that if you link two  object  files,  the  first  of
  100.        which  has  been  compiled  with  -g  while the second one
  101.        hasn't, time of the second file will be attributed to  the
  102.        last  line  of the first file.  You can avoid any problems
  103.        by linking the lliibbbbmmoonn..aa library (which should  have  been
  104.        compiled with -g) immediately after your -g compiled files
  105.        and before any others.
  106.  
  107.        Profiling will not be done while your program is  blocking
  108.        the VTALRM signal.
  109.  
  110. AAUUTTHHOORR
  111.        Bas   de   Bakker,   who   can  be  reached  by  email  at
  112.        bas@phys.uva.nl.  The latest version of  bbpprrooff  should  be
  113.        available    at    sunsite.unc.edu    in   the   directory
  114.        /pub/Linux/devel.
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.                     Version 1.1   13 July 1994                  2
  131.  
  132.  
  133.